using UnityEngine;
using System.Collections;


[System.Serializable]
public class InputAttack
{
	public	string[]		m_sButtonList;
	public	float			m_fMaxTimeBetweenSteps;
	private	float			m_fTimeCur;
	private	int				m_iStepCur;
	
	public	void StartCheck()
	{
		m_iStepCur			= 0;
	}
	
	public	bool UpdateAndCheckCompletion(float _fDeltaTime)
	{
		// update the time only if the combo started
		if(m_iStepCur > 0)
		{ 
			m_fTimeCur += _fDeltaTime;
			
			// check combo loss
			if(m_fTimeCur > m_fMaxTimeBetweenSteps)
			{
				m_iStepCur = 0;
			}
		}
		if(Input.GetButtonDown(m_sButtonList[m_iStepCur]))
		{
			++m_iStepCur;
			if(m_iStepCur >= m_sButtonList.Length)
			{
				return true;
			}
		}
		
		return false;
	}
}


